<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>IDA SDK: Operand types</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">IDA SDK
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="files.html"><span>Header&#160;Files</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">Operand types<div class="ingroups"><a class="el" href="group__operands.html">Operands</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Various types of instruction operands. </p>
<p>The kernel already knows about some operand types and associates them with fields in <a class="el" href="classop__t.html" title="Operand of an instruction. ">op_t</a>.</p>
<p>IDA also allows you define processor specific operand types (o_idpspec...). You are free to give any meaning to these types. We suggest you to create a #define to use mnemonic names. However, don't forget that the kernel will know nothing about operands of those types. You may use any additional fields of <a class="el" href="classop__t.html" title="Operand of an instruction. ">op_t</a> to store processor specific operand information. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:gad68bb114d00bf1541955467158677fa6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad68bb114d00bf1541955467158677fa6"></a>
const <a class="el" href="ua_8hpp.html#aaf9da6ae7e8b201108fc225adf13b4d9">optype_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__o__.html#gad68bb114d00bf1541955467158677fa6">o_void</a> = 0</td></tr>
<tr class="memdesc:gad68bb114d00bf1541955467158677fa6"><td class="mdescLeft">&#160;</td><td class="mdescRight">No Operand. <br /></td></tr>
<tr class="separator:gad68bb114d00bf1541955467158677fa6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab490f48c733f3d29c700bb5d70ecc198"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="ua_8hpp.html#aaf9da6ae7e8b201108fc225adf13b4d9">optype_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__o__.html#gab490f48c733f3d29c700bb5d70ecc198">o_reg</a> = 1</td></tr>
<tr class="memdesc:gab490f48c733f3d29c700bb5d70ecc198"><td class="mdescLeft">&#160;</td><td class="mdescRight">General Register (al,ax,es,ds...).  <a href="#gab490f48c733f3d29c700bb5d70ecc198">More...</a><br /></td></tr>
<tr class="separator:gab490f48c733f3d29c700bb5d70ecc198"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac180aea251826e5e5e484905e116c4cc"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="ua_8hpp.html#aaf9da6ae7e8b201108fc225adf13b4d9">optype_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__o__.html#gac180aea251826e5e5e484905e116c4cc">o_mem</a> = 2</td></tr>
<tr class="memdesc:gac180aea251826e5e5e484905e116c4cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Direct Memory Reference (DATA).  <a href="#gac180aea251826e5e5e484905e116c4cc">More...</a><br /></td></tr>
<tr class="separator:gac180aea251826e5e5e484905e116c4cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga622c0d3c3c8af0bed284a02b496ec288"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="ua_8hpp.html#aaf9da6ae7e8b201108fc225adf13b4d9">optype_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__o__.html#ga622c0d3c3c8af0bed284a02b496ec288">o_phrase</a> = 3</td></tr>
<tr class="memdesc:ga622c0d3c3c8af0bed284a02b496ec288"><td class="mdescLeft">&#160;</td><td class="mdescRight">Memory Ref [Base Reg + Index Reg].  <a href="#ga622c0d3c3c8af0bed284a02b496ec288">More...</a><br /></td></tr>
<tr class="separator:ga622c0d3c3c8af0bed284a02b496ec288"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2ae70c4ac00043f25a469a506a6f504f"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="ua_8hpp.html#aaf9da6ae7e8b201108fc225adf13b4d9">optype_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__o__.html#ga2ae70c4ac00043f25a469a506a6f504f">o_displ</a> = 4</td></tr>
<tr class="memdesc:ga2ae70c4ac00043f25a469a506a6f504f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Memory Reg [Base Reg + Index Reg + Displacement].  <a href="#ga2ae70c4ac00043f25a469a506a6f504f">More...</a><br /></td></tr>
<tr class="separator:ga2ae70c4ac00043f25a469a506a6f504f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga85e77bd8098a47465cd8e1193b6e154c"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="ua_8hpp.html#aaf9da6ae7e8b201108fc225adf13b4d9">optype_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__o__.html#ga85e77bd8098a47465cd8e1193b6e154c">o_imm</a> = 5</td></tr>
<tr class="memdesc:ga85e77bd8098a47465cd8e1193b6e154c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Immediate Value.  <a href="#ga85e77bd8098a47465cd8e1193b6e154c">More...</a><br /></td></tr>
<tr class="separator:ga85e77bd8098a47465cd8e1193b6e154c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac4a43a41f9a3a31b7bb6193e6d3cc447"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="ua_8hpp.html#aaf9da6ae7e8b201108fc225adf13b4d9">optype_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__o__.html#gac4a43a41f9a3a31b7bb6193e6d3cc447">o_far</a> = 6</td></tr>
<tr class="memdesc:gac4a43a41f9a3a31b7bb6193e6d3cc447"><td class="mdescLeft">&#160;</td><td class="mdescRight">Immediate Far Address (CODE).  <a href="#gac4a43a41f9a3a31b7bb6193e6d3cc447">More...</a><br /></td></tr>
<tr class="separator:gac4a43a41f9a3a31b7bb6193e6d3cc447"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga05209644e1ec11a2b0d96809bb60d6d8"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="ua_8hpp.html#aaf9da6ae7e8b201108fc225adf13b4d9">optype_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__o__.html#ga05209644e1ec11a2b0d96809bb60d6d8">o_near</a> = 7</td></tr>
<tr class="memdesc:ga05209644e1ec11a2b0d96809bb60d6d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Immediate Near Address (CODE).  <a href="#ga05209644e1ec11a2b0d96809bb60d6d8">More...</a><br /></td></tr>
<tr class="separator:ga05209644e1ec11a2b0d96809bb60d6d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga93c65fe52df27c2cf286579834e89f1c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga93c65fe52df27c2cf286579834e89f1c"></a>
const <a class="el" href="ua_8hpp.html#aaf9da6ae7e8b201108fc225adf13b4d9">optype_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__o__.html#ga93c65fe52df27c2cf286579834e89f1c">o_idpspec0</a> = 8</td></tr>
<tr class="memdesc:ga93c65fe52df27c2cf286579834e89f1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">processor specific type. <br /></td></tr>
<tr class="separator:ga93c65fe52df27c2cf286579834e89f1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga28544d70e5118d18bc443b1551bfb0d4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga28544d70e5118d18bc443b1551bfb0d4"></a>
const <a class="el" href="ua_8hpp.html#aaf9da6ae7e8b201108fc225adf13b4d9">optype_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__o__.html#ga28544d70e5118d18bc443b1551bfb0d4">o_idpspec1</a> = 9</td></tr>
<tr class="memdesc:ga28544d70e5118d18bc443b1551bfb0d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">processor specific type. <br /></td></tr>
<tr class="separator:ga28544d70e5118d18bc443b1551bfb0d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6aeffb56e320e7815d2fa9d2788f7512"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6aeffb56e320e7815d2fa9d2788f7512"></a>
const <a class="el" href="ua_8hpp.html#aaf9da6ae7e8b201108fc225adf13b4d9">optype_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__o__.html#ga6aeffb56e320e7815d2fa9d2788f7512">o_idpspec2</a> = 10</td></tr>
<tr class="memdesc:ga6aeffb56e320e7815d2fa9d2788f7512"><td class="mdescLeft">&#160;</td><td class="mdescRight">processor specific type. <br /></td></tr>
<tr class="separator:ga6aeffb56e320e7815d2fa9d2788f7512"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga38b52acb452efd50718bcc910bc9dce7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga38b52acb452efd50718bcc910bc9dce7"></a>
const <a class="el" href="ua_8hpp.html#aaf9da6ae7e8b201108fc225adf13b4d9">optype_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__o__.html#ga38b52acb452efd50718bcc910bc9dce7">o_idpspec3</a> = 11</td></tr>
<tr class="memdesc:ga38b52acb452efd50718bcc910bc9dce7"><td class="mdescLeft">&#160;</td><td class="mdescRight">processor specific type. <br /></td></tr>
<tr class="separator:ga38b52acb452efd50718bcc910bc9dce7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8ea529384422fe137b199e9d849182c0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8ea529384422fe137b199e9d849182c0"></a>
const <a class="el" href="ua_8hpp.html#aaf9da6ae7e8b201108fc225adf13b4d9">optype_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__o__.html#ga8ea529384422fe137b199e9d849182c0">o_idpspec4</a> = 12</td></tr>
<tr class="memdesc:ga8ea529384422fe137b199e9d849182c0"><td class="mdescLeft">&#160;</td><td class="mdescRight">processor specific type. <br /></td></tr>
<tr class="separator:ga8ea529384422fe137b199e9d849182c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga610f9018ae82af4151f4270fca95be68"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="ua_8hpp.html#aaf9da6ae7e8b201108fc225adf13b4d9">optype_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__o__.html#ga610f9018ae82af4151f4270fca95be68">o_idpspec5</a> = 13</td></tr>
<tr class="memdesc:ga610f9018ae82af4151f4270fca95be68"><td class="mdescLeft">&#160;</td><td class="mdescRight">processor specific type.  <a href="#ga610f9018ae82af4151f4270fca95be68">More...</a><br /></td></tr>
<tr class="separator:ga610f9018ae82af4151f4270fca95be68"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="gab490f48c733f3d29c700bb5d70ecc198"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">o_reg = 1</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>General Register (al,ax,es,ds...). </p>
<p>The register number should be stored in <a class="el" href="classop__t.html#a428edf0d3e487135e3d08bd5a65772e4" title="number of register (o_reg) ">op_t::reg</a>.</p>
<p>All processor registers, including special registers, can be represented by this operand type. </p>

</div>
</div>
<a class="anchor" id="gac180aea251826e5e5e484905e116c4cc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">o_mem = 2</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Direct Memory Reference (DATA). </p>
<p>A direct memory data reference whose target address is known at compilation time.</p>
<p>The target virtual address is stored in <a class="el" href="classop__t.html#acaaeff517df0b7156b4b8521a3900cdc" title="virtual address pointed or used by the operand. ">op_t::addr</a> and the full address is calculated as to_ea( {cs}, <a class="el" href="classop__t.html#acaaeff517df0b7156b4b8521a3900cdc" title="virtual address pointed or used by the operand. ">op_t::addr</a> ). For the processors with complex memory organization the final address can be calculated using other segment registers. For flat memories, <a class="el" href="classop__t.html#acaaeff517df0b7156b4b8521a3900cdc" title="virtual address pointed or used by the operand. ">op_t::addr</a> is the final address and {cs} is usually equal to zero. In any case, the address within the segment should be stored in <a class="el" href="classop__t.html#acaaeff517df0b7156b4b8521a3900cdc" title="virtual address pointed or used by the operand. ">op_t::addr</a>. </p>

</div>
</div>
<a class="anchor" id="ga622c0d3c3c8af0bed284a02b496ec288"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">o_phrase = 3</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Memory Ref [Base Reg + Index Reg]. </p>
<p>A memory reference using register contents.</p>
<p>Indexed, register based, and other addressing modes can be represented with the operand type. This addressing mode can not contain immediate values (use <a class="el" href="group__o__.html#ga2ae70c4ac00043f25a469a506a6f504f" title="Memory Reg [Base Reg + Index Reg + Displacement]. ">o_displ</a> instead). The phrase number should be stored in <a class="el" href="classop__t.html#a583f4819af0dc38593765cd7e6ce17cf" title="number of register phrase (o_phrase,o_displ). ">op_t::phrase</a>. To denote the pre-increment and similar features please use additional operand fields like op_t::specflag... Usually <a class="el" href="classop__t.html#a583f4819af0dc38593765cd7e6ce17cf" title="number of register phrase (o_phrase,o_displ). ">op_t::phrase</a> contains the register number and additional information is stored in op_t::specflags... Please note that this operand type can not contain immediate values (except the scaling coefficients). </p>

</div>
</div>
<a class="anchor" id="ga2ae70c4ac00043f25a469a506a6f504f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">o_displ = 4</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Memory Reg [Base Reg + Index Reg + Displacement]. </p>
<p>A memory reference using register contents with displacement.</p>
<p>The displacement should be stored in the <a class="el" href="classop__t.html#acaaeff517df0b7156b4b8521a3900cdc" title="virtual address pointed or used by the operand. ">op_t::addr</a> field. The rest of information is stored the same way as in <a class="el" href="group__o__.html#ga622c0d3c3c8af0bed284a02b496ec288" title="Memory Ref [Base Reg + Index Reg]. ">o_phrase</a>. </p>

</div>
</div>
<a class="anchor" id="ga85e77bd8098a47465cd8e1193b6e154c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">o_imm = 5</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Immediate Value. </p>
<p>Any operand consisting of only a number is represented by this operand type.</p>
<p>The value should be stored in <a class="el" href="classop__t.html#a6baa38b521c143a794640d82df109ae2" title="operand value (o_imm) or outer displacement (o_displ+OF_OUTER_DISP). ">op_t::value</a>. You may sign extend short (1-2 byte) values. In any case don't forget to specify <a class="el" href="classop__t.html#a9d0ea64a2929fc998bca6cebd1b91c09" title="Type of operand value (see Operand value types). ">op_t::dtype</a> (should be set for all operand types). </p>

</div>
</div>
<a class="anchor" id="gac4a43a41f9a3a31b7bb6193e6d3cc447"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">o_far = 6</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Immediate Far Address (CODE). </p>
<p>If the current processor has a special addressing mode for inter-segment references, then this operand type should be used instead of <a class="el" href="group__o__.html#ga05209644e1ec11a2b0d96809bb60d6d8" title="Immediate Near Address (CODE). ">o_near</a>.</p>
<p>If you want, you may use <a class="el" href="group___p_r__.html#ga884adc60ef0e7236192b78ec4f900f0e" title="don&#39;t allow near xrefs between segments with different bases ">PR_CHK_XREF</a> in <a class="el" href="structprocessor__t.html#a6542af67172bea21cda8b81c6671d775" title="Processor feature bits ">processor_t::flag</a> to disable inter-segment calls if <a class="el" href="group__o__.html#ga05209644e1ec11a2b0d96809bb60d6d8" title="Immediate Near Address (CODE). ">o_near</a> operand type is used. Currently only IBM PC uses this flag. </p>

</div>
</div>
<a class="anchor" id="ga05209644e1ec11a2b0d96809bb60d6d8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">o_near = 7</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Immediate Near Address (CODE). </p>
<p>A direct memory code reference whose target address is known at the compilation time.</p>
<p>The target virtual address is stored in <a class="el" href="classop__t.html#acaaeff517df0b7156b4b8521a3900cdc" title="virtual address pointed or used by the operand. ">op_t::addr</a> and the final address is always to_ea({cs}, <a class="el" href="classop__t.html#acaaeff517df0b7156b4b8521a3900cdc" title="virtual address pointed or used by the operand. ">op_t::addr</a>). Usually this operand type is used for the branches and calls whose target address is known. If the current processor has 2 different types of references for inter-segment and intra-segment references, then this should be used only for intra-segment references.</p>
<p>If the above operand types do not cover all possible addressing modes, then use o_idpspec... operand types. </p>

</div>
</div>
<a class="anchor" id="ga610f9018ae82af4151f4270fca95be68"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="ua_8hpp.html#aaf9da6ae7e8b201108fc225adf13b4d9">optype_t</a> o_idpspec5 = 13</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>processor specific type. </p>
<p>(there can be more processor specific types) </p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
